export default{
  state:{
      id:0,
      username:'',
      session_id:''
  },
  mutations:{
      setUser(state,user){
          state.id=user.id
          state.username=user.username
          state.session_id=user.session_id
      },
      logout(state){
          state.id=0
          state.username=''
          state.session_id=''
      },
      getUser(state, payload){ // 修改这一行，接收 payload 参数
          return state
      }
  },
  actions:{},
  getters:{isLogin(state){
      return state.id!==0
  }},
  namespaced:true
}
